<template>
    <div class="stopWrapper" @click="stopClick">
        <img v-if="flag === false" class='stopWrapperimg'  src="@/assets/allchoice.png">
        <img v-if="flag === true" class='stopWrapperimg'  src="@/assets/allchoice_stop.png">
    </div>
</template>

<script setup>
import {ref} from "vue";
import {getCurrentInstance} from "vue";
let ws = getCurrentInstance().proxy.$ws;
let flag = ref(false)
function stopClick() {
    flag.value= !flag.value;
    if(flag.value === true){
        ws.send(JSON.stringify({"order":"SetAllFaultPoints"}));
    }else{
        ws.send(JSON.stringify({"order":"ResetAllFaultPoints"}));
    }
}
</script>

<style scoped lang="scss">
.stopWrapper{
    position: relative; width: 100px; height: 100px;
    cursor: pointer;
    .stopWrapperimg{
        width: 100%;
        height: 100%;
    }
}

</style>
